AppService   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 10
dl 0
loc 13
rs 10
c 0
b 0
f 0

2 Functions

Rating   Name   Duplication   Size   Complexity  
A handleDefaultEvent 0 2 1
A rabbitEvent 0 2 1
1
import { Inject, Injectable } from '@nestjs/common';
2
import { TRANSPORT_EVENT_BUS_SERVICE } from 'nestjs-transport-eventbus';
3
import { IEventBus } from '@nestjs/cqrs';
4
import { DefaultEvent } from './events/default.event';
5
import { RabbitEvent } from './events/rabbit.event';
6
7
@Injectable()
8
export class AppService {
9
  constructor(
10
      @Inject(TRANSPORT_EVENT_BUS_SERVICE) private readonly eventBus: IEventBus
11
  ){
12
13
  }
14
  handleDefaultEvent(): void {
15
    this.eventBus.publish(new DefaultEvent('Pass some param'));
16
  }
17
  rabbitEvent(): void {
18
    this.eventBus.publish(new RabbitEvent('Pass some param'));
19
  }
20
}
21